// 
// Basic syntax test, this should be translated in/from JooScript (deprecated syntax)
//
$Unit(__PATH__, __FILE__, function(u,r,g){

    // we will operate in strict context to catch all errors
    //"use strict";

    // fixme a.b.c.
    u.Package("a.b.c.", function(g){

        var Foo = u.buildClass("Foo")
        var Bar = u.buildClass("Bar")
        
        // declare class in the group a.b.c
        g.ABC = u.buildClass( // build class
                "ABC",  // class name
                [u.A, r.B, g.C],   // ancestors
                function(c){ // class body
                    //
                    // actual class constructor
                    this.__new__ =  function(self){ 
                    }
                    this.foo =  function(self, a, b){ 
                    }
                    this.bar =  function(self, a, b){ 
                    }
                    this.baz =  function(self, a, b, __rest__){ 
                        self.x = __rest__[0]
                    }
                },{ // class spec (role)
                    __new__ : {
                        type: u.Type.FUNCTION,
                        constructor: true 
                    },
                    foo : {
                        type: u.Type.FUNCTION,
                        argumentType: [u.Type.STRING, Bar],
                        returnType: Foo
                    },
                    bar : {
                        type: u.Type.FUNCTION,
                        argumentType: [u.Type.UINT, Foo],
                        returnType: u.Type.NUMBER
                    },
                    baz : u.Type.FUNCTION
                })
    });

    // using global names ... 
    $Package("d.e.f", function(){
        $buildClass("def", null, function(z){
            
        })
    })

    var test = $buildClass(null, null, null)

    function JSClass() {
    }

    var foo = new JSClass
    var bar = new JSClass("abc")

    // in jooscript "!", "&&" and "||" is "not", "and" and "or" respectively
    if( a && b || !c )
        test()
    else {
        // empty
    }

    // import one
    this.Import("a.b.c.*", "d.e.f")

})

